package com.xikeda.controller;

import com.xikeda.model.UsernaadTable;
import com.xikeda.service.imp.QueryDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Author Xiao Linqing
 * @date 2020/6/6 18:52
 */
@Controller
public class QueryDetailsController {
    @Resource
    private QueryDetailsService queryDetailsService;
    public QueryDetailsService getQueryDetailsService() {
        return queryDetailsService;
    }
    @Autowired
    public void setQueryDetailsService(QueryDetailsService queryDetailsService) {
        this.queryDetailsService = queryDetailsService;
    }
    @RequestMapping("/finduser")
    @ResponseBody
    public String finduser(HttpServletRequest request, HttpServletResponse response) throws Exception{
        String user_id=request.getParameter("user_id");
        System.out.println(user_id);
        List<UsernaadTable> list=this.getQueryDetailsService().Finduser(user_id);
        if(list!=null&&list.size()>0){
            for(UsernaadTable i:list){
                System.out.print(i.getCourier_address()+" ");
                System.out.print(i.getTelephone()+" ");
                System.out.print(i.getTrue_name()+" ");
                System.out.println("-----------");
            }
        }
        return "demo";
    }
    @RequestMapping("test6")
    public String InquiryExpress1(HttpServletRequest request, HttpServletResponse response){
        return "demo";
    }
}

